package com.kitwee.serialport.data.model;

public enum Stopbits {

    One(1),

    Two(2);

    private final int value;

    Stopbits(int value) {
        this.value = value;
    }

    public static Stopbits fromValue(int value) {
        switch (value) {
            case 1:
                return One;
            case 2:
                return Two;
            default:
                throw new IllegalArgumentException("Invalid value!");
        }
    }

    public int value() {
        return value;
    }


}
